package com.xiaoq.matrix.minipro.service.impl;

import me.chanjar.weixin.open.api.impl.WxOpenServiceImpl;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;

//import com.github.binarywang.demo.wechat.config.RedisProperies;
//import com.github.binarywang.demo.wechat.service.WxOpenServiceDemo;
import com.xiaoq.RedisProperties;
import com.xiaoq.matrix.minipro.config.WechatOpenProperties;

@Service
@EnableConfigurationProperties({WechatOpenProperties.class, RedisProperties.class})
public class WxOpenServiceDemo extends WxOpenServiceImpl {
//	
//	@Autowired
//	private WechatOpenProperties wechatOpenProperties;
//	@Autowired
//	private RedisProperties redisProperies;
//
//	private static JedisPool pool;
////
//	    @PostConstruct
//	    public void init() {
//	        WxOpenInRedisConfigStorage inRedisConfigStorage = new WxOpenInRedisConfigStorage(new JedisPool());
//	        inRedisConfigStorage.setComponentAppId(wechatOpenProperties.getComponentAppId());
//	        inRedisConfigStorage.setComponentAppSecret(wechatOpenProperties.getComponentSecret());
//	        inRedisConfigStorage.setComponentToken(wechatOpenProperties.getComponentToken());
//	        inRedisConfigStorage.setComponentAesKey(wechatOpenProperties.getComponentAesKey());
//	        setWxOpenConfigStorage(inRedisConfigStorage);
//	    }

//	    private JedisPool getJedisPool() {
//	        if (pool == null) {
//	            synchronized (WxOpenServiceDemo.class) {
//	                if (pool == null) {
//	                	pool = new JedisPo
//	                    pool = new JedisPool(redisProperies)//, redisProperies.getHost(),
//	                            redisProperies.getPort(), redisProperies.getConnectionTimeout(),
//	                            redisProperies.getSoTimeout(), redisProperies.getPassword(),
//	                            redisProperies.getDatabase(), redisProperies.getClientName(),
//	                            redisProperies.isSsl(), redisProperies.getSslSocketFactory(),
//	                            redisProperies.getSslParameters(), redisProperies.getHostnameVerifier());
//	                }
//	            }
//	        }
//	        return pool;
//	    }
   
}
